import App from './App'

import Vue from 'vue'
Vue.config.productionTip = false

import {
	requist
} from 'util/api.js'
Vue.prototype.$http = requist
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
import moment from "moment";
moment.locale('zh-cn');
Vue.prototype.$moment = moment
App.mpType = 'app'
const app = new Vue({
	...App
})
Vue.filter("formatDate", (data) => {
	const nDate = new Date(data);
	// const year = nDate.getFullYear();
	// const month = (nDate.getMonth() + 1).toString().padStart(2, 0);
	// const day = nDate.getDate().toString().padStart(2, 0);
	let myyear = nDate.getFullYear();
	let mymonth = nDate.getMonth() + 1;
	let myweekday = nDate.getDate();
	let myHour = nDate.getHours();
	let myMin = nDate.getMinutes();
	let mySec = nDate.getSeconds();
	if (mymonth < 10) {
		mymonth = '0' + mymonth;
	}
	if (myweekday < 10) {
		myweekday = '0' + myweekday;
	}
	if (myHour < 10) {
		myHour = '0' + myHour;
	}
	if (myMin < 10) {
		myMin = '0' + myMin;
	}
	if (mySec < 10) {
		mySec = '0' + mySec;
	}
	return (myyear + '-' + mymonth + '-' + myweekday + ' ' + myHour + ':' + myMin + ':' + mySec);
	// return year + '-' + month + '-' + day
})
app.$mount()
